# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models

# Create your models here.

class Host(models.Model):
    hostname = models.CharField(max_length=255, verbose_name='主机名')
    ipaddress = models.GenericIPAddressField(max_length=255,verbose_name='IP地址')
    appgroup = models.CharField(max_length=255,verbose_name='应用分组')
    user_id = models.ForeignKey('h_username', on_delete=False,default=1)
    password_id = models.ForeignKey('h_password',on_delete=False,default=1)
    def __unicode__(self):
        return self.title

class h_username(models.Model):
    username = models.CharField(max_length=30, verbose_name='用户名')
    def __unicode__(self):
        return self.title

class h_password(models.Model):
    password = models.CharField(max_length=30, verbose_name='密码')
    def __unicode__(self):
        return self.title